package com.cordershy.pojo;

import org.apache.ibatis.type.Alias;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DecimalFormat;

@Component
@Alias(value = "debt")
public class debt implements Comparable<debt>,Serializable {
    private int debtid;
    private String debtname;
    private String debtnote;
    private BigDecimal debt;
    private String username;

    public debt() {
    }

    public debt(int debtid, String debtname, String debtnote, BigDecimal debt, String username) {
        this.debtid = debtid;
        this.debtname = debtname;
        this.debtnote = debtnote;
        this.debt = debt;
        this.username = username;
    }

    public void setDebtid(int debtid) {
        this.debtid = debtid;
    }

    public void setDebtname(String debtname) {
        this.debtname = debtname;
    }

    public void setDebtnote(String debtnote) {
        this.debtnote = debtnote;
    }

    public void setDebt(BigDecimal debt) {
        this.debt = debt;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getDebtid() {
        return debtid;
    }

    public String getDebtname() {
        return debtname;
    }

    public String getDebtnote() {
        return debtnote;
    }

    public BigDecimal getDebt() {
        return debt;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
        return "debt{" +
                "debtid=" + debtid +
                ", debtname='" + debtname + '\'' +
                ", debtnote='" + debtnote + '\'' +
                ", debt=" + debt +
                ", username='" + username + '\'' +
                '}';
    }

    @Override
    public int compareTo(com.cordershy.pojo.debt o) {
        return o.getDebtid()-this.getDebtid();
    }
}
